#ifndef TERMINAL_CURSOR_H
#define TERMINAL_CURSOR_H

    #include"gui_color.h"


    typedef struct
    {
        uint8_t width;
        uint8_t height;
        uint8_t shape;
        gui_color_t color;
        int x;
        int y;
        uint8_t visual;
    }console_cursor_t;

    enum cursor_shape {
        CS_SOLID_FRAME = 0,     
        CS_HOLLOW_BOX,         
        CS_VERTICAL_BAR,       
        CS_UNDERLINE,         
        CS_MAX_NR,
    };

    extern console_cursor_t cursor;

    #define CONSOLE_CURSOR_COLOR   GUI_WHITE

    #define CONSOLE_SCROLL_DOWN 0
    #define CONSOLE_SCROLL_UP  1

    void set_cursor_size();
    void set_cursor_shape(uint8_t shape);
    void set_cursor_color(gui_color_t color);
    void clean_cursor();
    void cursor_pos_check();
    void move_cursor(int x,int y);
    void move_cursor_off(int x,int y);
    void draw_cursor();
    void focus_cursor();
    #define terminal_cursor_clean clean_cursor
    int terminal_cursor_init();

    static inline void get_cursor(int *cx,int *cy)
    {
        if(!cx||!cy)
            return ;
        *cx=cursor.x;
        *cy=cursor.y;
    }
#endif